//package com.example.syn_4s
//
//
//import android.content.Intent
//import android.net.Uri
//import io.flutter.plugin.common.MethodChannel
//import io.flutter.plugin.common.PluginRegistry
//
//class ApkInstaller(private val activity: PluginRegistry.ActivityResultListener) {
//    fun installApk(uriString: String, result: MethodChannel.Result) {
//        val fileUri = Uri.parse(uriString)
//        val intent = Intent(Intent.ACTION_VIEW)
//        intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
//        intent.setDataAndType(fileUri, "application/vnd.android.package-archive")
//        activity.onActivityResult(0, 0, null) { _, resultCode ->
//            when (resultCode) {
//                PluginRegistry.ActivityResultListener.RESULT_OK -> result.success(true)
//                else -> result.success(false)
//            }
//        }
//        activity.activity.startActivity(intent)
//    }
//}